package com.cysoft.starter.log.core.properties.output;

import lombok.Data;

/**
 * @author 玖零
 * @version V0.0.1
 * @project cysoft-spring-boot-starter-log
 * @package com.cysoft.starter.log.core.properties.output
 * @date 2025-02-27 20:20
 * @desc ElasticSearch属性配置文件,基本的配置信息通过bboss实现,此处只配置索引相关信息
 */
@Data
public class ElasticSearchProperties {


    /**
     * 索引名称
     */
    private String indexName = "cysoft_operation_log";

    /**
     * 索引后缀 和索引名称共同组成需要创建的索引
     */
    private String indexSuffix;

    /**
     * 索引mapping映射
     */
    private String indexMapping = "{\"mappings\":{\"properties\":{\"id\":{\"type\":\"long\"},\"logType\":{\"type\":\"keyword\"},\"requestUrl\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\"requestIp\":{\"type\":\"ip\"},\"requestHeader\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\"requestBody\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\"responseBody\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\"requestMethod\":{\"type\":\"keyword\"},\"requestResult\":{\"type\":\"boolean\"},\"errorMessage\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\"createTime\":{\"type\":\"date\",\"format\":\"yyyy-MM-dd HH:mm:ss\"},\"duration\":{\"type\":\"long\"},\"packageInfo\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\"classInfo\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\"methodInfo\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}},\"operator\":{\"type\":\"text\",\"fields\":{\"keyword\":{\"type\":\"keyword\",\"ignore_above\":256}}}}}}";


}
